import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import button.StartButton;
import common.DrawPanel;
import common.ImagePanel;

public class MF extends JFrame {
	private JPanel contentPane;
	private BorderLayout borderLayout1 = new BorderLayout();
	private JLabel jLabel1 = new JLabel(); // 添加的jLabel 组件
	DrawPanel drawPane = new DrawPanel(new StartButton().getImage()); // 创建DrawPane 的实例
	private static final File imgFile=new File("D:\\GitHome\\draw\\src\\main\\java\\src\\main\\resources\\gzbank.jpg");
	public static void main(String[] args) throws IOException {
		
		MF mf=new MF();
		
		ImagePanel drawPane2 = new ImagePanel(ImageIO.read(imgFile),null);
		mf.add(drawPane2);
		mf.setBounds(10, 10, 500, 500);
		mf.setVisible(true);
		mf.jbInit();
	}
	public void jbInit() {
		//setIconImage(Toolkit.getDefaultToolkit().createImage(MainFrame.class.getResource("[Your Icon]")));
		contentPane = (JPanel) this.getContentPane();
		jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
		jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
		jLabel1.setText("图像移动演示"); //标签的显示文本
		contentPane.setLayout(borderLayout1);
		this.setSize(new Dimension(400, 300));
		this.setTitle("JImageMoveDemo");
		//contentPane.add(jLabel1, BorderLayout.NORTH);
		contentPane.add(this.drawPane,BorderLayout.CENTER);//添加drawPane 对象
		}
	public DrawPanel getDrawPane() {
		return drawPane;
	}
	public void setDrawPane(DrawPanel drawPane) {
		this.drawPane = drawPane;
	}
}
